package cn.enjoy.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * VM options: -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 * @author K
 * @date 2021/2/2 19:48
 */
public class HeapOOM {

    static class OOMObject {
    }

    public static void main(String[] args) throws InterruptedException {
        List<OOMObject> list = new ArrayList<>();
        Thread.sleep(20000);
        while(true) {
            list.add(new OOMObject());
        }
    }

}